home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3634 < prev    next >
Encoding:
Text File  |  1996-08-05  |  946 b   |  32 lines

  1. Path: colossus.holonet.net!windmill!charlie.brown
  2. Distribution: world
  3. Newsgroups: comp.lang.c
  4. X-Apparently-to: FRED@SPIDER.COMPART.FI
  5. From: charlie.brown@windmill.com (Charlie Brown)
  6. References: <4ebc03$4gv@gate.compart.fi>
  7. Date: Mon, 29 Jan 1996 14:17:00 -0600
  8. Organization: The Windmill Company BBS - 806-792-6116
  9. Subject: The size of a file
  10. Message-ID: <59.28250.5782@windmill.com>
  11.  
  12. F>This is driving me nuts.  I can't find a simple way to get the size of a
  13.  >disk file.  This must be possible using the standard C library, but I
  14.  >haven't figured out how!
  15.  
  16. This works with MSC, Borland may have a different name
  17. for _dos_findfirst().
  18.  
  19. #include <dos.h>
  20. long fsize(filespec)
  21. char *filespec;
  22. {
  23.         struct find_t fileinfo;
  24.  
  25.         if(0 ==  _dos_findfirst(filespec,0,&fileinfo))
  26.                 return fileinfo.size;
  27.         else
  28.                 return 0L;
  29. }
  30. ---
  31.  * QMPro 1.01 41-4987 * BorgBurger:  We do it our way. Your way is irrelevant.
  32.